package useTool;

import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;
import java.util.Date;
import standard.Standard;

public class ThreadDoOtherThing extends Thread {
	private Socket socket;
	public ThreadDoOtherThing(Socket socket)
	{
		this.socket = socket;
	}
	
	@Override
	public void run()
	{
		while(true){
			try
			{
				InputStream is = this.socket.getInputStream();
				if(is.available()==0)
				{
					long time = System.currentTimeMillis();
					System.out.println("Now the time is "+ new Date(time));
				}
				else
				{
					System.out.println("Object Arrive!!!!!!");
					break;
				}
			}catch(IOException e)
			{
				e.printStackTrace();
			}
		}
	}
}
